#!/usr/bin/env bash

mkdir -p ../../data/tmp_classification_branch1/
mkdir -p ../../data/tmp_classification_branch1/data
mkdir -p ../../data/tmp_classification_branch1/models
mkdir -p ../../data/tmp_classification_branch1/results
cd ../../data/tmp_classification_branch1/data
ln -s ../../reduced_candidates/3dcnn_cddv15_v2_kaggle_testset_candidates_v10.pkl 3dcnn_cddv15_v2_kaggle_testset_candidates_v10.pkl
ln -s ../../reduced_candidates/3dcnn_kaggle_testset_candidates_v4_newlabel.pkl 3dcnn_kaggle_testset_candidates_v4_newlabel.pkl
ln -s ../../reduced_candidates/lidc_kaggle_candidates_v15.hdf5 lidc_kaggle_candidates_v15.hdf5
ln -s ../../reduced_candidates/lidc_kaggle_candidates_v9.hdf5 lidc_kaggle_candidates_v9.hdf5
ln -s ../../reduced_candidates/LIDC_true_nodules.pkl LIDC_true_nodules.pkl
ln -s ../../reduced_candidates/LIDC_true_nodules_vol.hdf5 LIDC_true_nodules_vol.hdf5
cd ../../../code/classification_branch1

# for test set
python change_fold_to_kaggle_4_fold.py

# pretrain on LIDC with 9 labels
python cmd_mal.py vgg_shortcut_lidc_pretrain
# train model v9 with testset ()
python cmd_all.py --name=vgg_shortcut_cddv9_with_test_fold0 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=1 --valid_folds=0 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_with_test_fold1 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=1 --valid_folds=1 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_with_test_fold2 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=1 --valid_folds=2 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_with_test_fold3 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=1 --valid_folds=3 --gpus=0
# train model v9 without testset
python cmd_all.py --name=vgg_shortcut_cddv9_without_test_fold0 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=0 --valid_folds=0 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_without_test_fold1 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=0 --valid_folds=1 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_without_test_fold2 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=0 --valid_folds=2 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv9_without_test_fold3 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5 --prob_thresh=0.1 --include_testset=0 --valid_folds=3 --gpus=0
# train model v15 with testset
python cmd_all.py --name=vgg_shortcut_cddv15_v2_with_test_fold0 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=1 --valid_folds=0 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_with_test_fold1 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=1 --valid_folds=1 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_with_test_fold2 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=1 --valid_folds=2 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_with_test_fold3 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=1 --valid_folds=3 --gpus=0
# train model v15 without testset
python cmd_all.py --name=vgg_shortcut_cddv15_v2_without_test_fold0 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=0 --valid_folds=0 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_without_test_fold1 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=0 --valid_folds=1 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_without_test_fold2 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=0 --valid_folds=2 --gpus=0
python cmd_all.py --name=vgg_shortcut_cddv15_v2_without_test_fold3 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl\
 --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5 --prob_thresh=0.65 --include_testset=0 --valid_folds=3 --gpus=0
# stage1 cross validation test
python predict_cmd.py --model_name=vgg_shortcut_cddv9_without_test --model_epoch=epoch-0099 --prob_thresh=0.1 --train_or_test=train \
 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv9_with_test --model_epoch=epoch-0099 --prob_thresh=0.1 --train_or_test=train \
 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv15_v2_without_test --model_epoch=epoch-0099 --prob_thresh=0.65 --train_or_test=train \
 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv15_v2_with_test --model_epoch=epoch-0099 --prob_thresh=0.65 --train_or_test=train \
 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv9_without_test --model_epoch=epoch-0089 --prob_thresh=0.1 --train_or_test=train \
 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv9_with_test --model_epoch=epoch-0089 --prob_thresh=0.1 --train_or_test=train \
 --candidate_file=3dcnn_candidates_list_v9_4fold_newfold_newlabel.pkl --candidate_vol_file=lidc_kaggle_candidates_v9.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv15_v2_without_test --model_epoch=epoch-0089 --prob_thresh=0.65 --train_or_test=train \
 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5
python predict_cmd.py --model_name=vgg_shortcut_cddv15_v2_with_test --model_epoch=epoch-0089 --prob_thresh=0.65 --train_or_test=train \
 --candidate_file=3dcnn_cddv15_v2_4fold_alldata.pkl --candidate_vol_file=lidc_kaggle_candidates_v15.hdf5

